<?php

class Soul_Annotation_Executor {

    public static function executeFromClass(ReflectionClass $class){
        self::execute(Soul_Annotation_Parser::parseFromClass($class));
    }
    
    public static function executeFromFunction(ReflectionFunction $function){
        self::execute(Soul_Annotation_Parser::parseFromFunction($class));
    }
    
    public static function executeFromMethod(ReflectionMethod $method){
        self::execute(Soul_Annotation_Parser::parseFromMethod($class));
    }    
    
    public static function execute(array $attributes){
        foreach($attributes as $attribute){
            $attribute['attribute']->execute($attribute['arguments']);
        }
    }
}